package com.turing.system.controller;

import com.turing.system.service.CustomerWithdrawalsService;
import com.turing.system.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.text.ParseException;
import com.alibaba.fastjson.JSONObject;
import com.turing.system.service.KeeperWithdrawalsService;
import org.springframework.web.bind.annotation.*;
import result.Result;

import javax.annotation.Resource;


import javax.annotation.Resource;

@RestController
public class WithdrawalController {

    @Autowired
    private CustomerWithdrawalsService customerWithdrawalsService;

    @Resource
    private KeeperWithdrawalsService keeperWithdrawalsService;

    @GetMapping("/withdrawal/cgCoinChargeList")
    public Result cgCoinChargeList(
            @RequestParam(value = "cusNickname", required = false) String cusNickname,
            @RequestParam(value = "pageNum", required = false) Integer pageNum,
            @RequestParam(value = "pageSize", required = false) Integer pageSize){

        return customerWithdrawalsService.cgCoinChargeList(cusNickname,pageNum,pageSize);
    }

    /**
     * 1.7.1、50701增加商家流水(PC，手机)
     *
     * @return
     */
    @PostMapping("withdrawal/kwAddSave")
    public Result kwAddSave(@RequestBody JSONObject json) {

        return keeperWithdrawalsService.kwAddSave(json);
    }

}
